/**
 * @author helio
 */
if (!SALE.setting) SALE.setting = {}

if (!SALE.setting.UrlSettingPanel) {
	SALE.setting.UrlSettingPanel = Ext.extend(SALE.basicGridPanel, {
	
		layout: 'fit',
		border: false,
		bodyStyle : 'background-color: transparent;', 
		initComponent: function(){
			
			this.inputForm = new Ext.FormPanel({
				labelWidth: 60,
				border: false,
				autoHeight: true,
				buttonAlign: 'center',
				defaultType: 'textfield',
				bodyStyle : 'background-color: transparent;', 
												
				items: [{
					vtype: 'url',
					allowBlank: false,
					fieldLabel: '服务URL',
                    name: 'url',
                    value: SALE.App.configInfo.url,
                    anchor:'95%'		
				}],
		      
				
				buttons: [{
		            text: '保存',
		            iconCls: 'save',
					listeners: {
						"click": this.onSave.createDelegate(this)
					}
		        }]
			});
			
			this.items = this.inputForm;
			
			SALE.setting.UrlSettingPanel.superclass.initComponent.call(this);
		},
						
		onSave : function() {
			if(this.inputForm.form.isValid()) {
				var url = this.inputForm.form.findField("url").getValue();
				SALE.App.configInfo.url = SALE.Utils.config.checkServiceUrl(url);
				SALE.Action.urlSettingAction(this.close.createDelegate(this), url);				
			}
		}
	});
	
	Ext.reg('urlsetting', SALE.setting.UrlSettingPanel);
}